package com.photographysharing.mapper;

import com.photographysharing.dto.PhotoDTO;
import com.photographysharing.entity.Photos;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Z
* @description 针对表【photos】的数据库操作Mapper
* @createDate 2024-05-14 21:15:11
* @Entity com.photographysharing.entity.Photos
*/
@Mapper
public interface PhotosMapper extends BaseMapper<Photos> {

    public List<PhotoDTO> selectByAll(@Param("index") int index,
                                      @Param("size") int size,
                                      @Param("name") String name,
                                      @Param("userName") String userName,
                                      @Param("tag") String tag,
                                      @Param("categoryId") int categoryId);

    public int selctCount(@Param("name") String name,
                          @Param("userName") String userName,
                          @Param("tag") String tag,
                          @Param("categoryId") int categoryId);

    public PhotoDTO getById(String photoId);

    List<PhotoDTO> selectByUserId(@Param("index") int index,
                                  @Param("size") int size,
                                  @Param("name") String name,
                                  @Param("userId") String userId);

    int selectCountByUserId(@Param("name") String name,@Param("userId") String userId);

    List<PhotoDTO> selectByPag(@Param("index") int index,
                               @Param("size") int size,
                               @Param("name") String name,
                               @Param("userName") String userName,
                               @Param("tag") String tag,
                               @Param("categoryId") int categoryId);

    int selctByPagCount(@Param("name") String name,
                        @Param("userName") String userName,
                        @Param("tag") String tag,
                        @Param("categoryId") int categoryId);
}




